import Mock from 'mockjs'

const list = Mock.mock({
  'list|10': [
    {
      workDemandId: '@id',
      workDemandName: '@csentence(5, 15)',
      'workDemandType|1': [2, 1],
      'isRelease|1': [2, 1]
    }
  ]
})
const dictMap = {
  workDemandType: {
    1: 'dec',
    2: 'eeed'
  }
}
const pub = {
  isMore: 0,
  pageIndex: 1,
  pageSize: 10,
  startIndex: 0,
  totalNum: 1,
  totalPage: 1
}
export default [
  // 根据参数查询工作要求
  {
    url: '/elec/work/demande/getWorkDemandList',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...list,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  },
  // 发布工作要求
  {
    url: '/elec/work/demande/releaseWorkDemand',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: ''
      }
    }
  },
  // 修改保存工作要求
  {
    url: '/elec/work/demande/modifyWorkDemand',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: ''
      }
    }
  },
  // 新增保存工作要求
  {
    url: '/elec/work/demande/saveLabel',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: ''
      }
    }
  }
]
